import { defineStore } from 'pinia'

export interface Message {
  id: string
  role: 'user' | 'ai'
  content: string
}

export const useChatStore = defineStore('chat', {
  state: () => ({
    messages: [] as Message[],
  }),
  actions: {
    addMessage(msg: Message) {
      this.messages.push(msg)
    },
    clearMessages() {
      this.messages = []
    },
  },
})
